#include "MessageCreationDialog.h"
#include "ui_MessageCreationDialog.h"

MessageCreationDialog::MessageCreationDialog(const QString& fileName, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MessageCreationDialog)
{
    ui->setupUi(this);
    nvPairList = new QList<xPL_NameValuePairForm*>();
    templateFilePath = fileName;
    initializeXml(templateFilePath);
    setupUi();
}

MessageCreationDialog::~MessageCreationDialog()
{
    delete ui;
}

void MessageCreationDialog::initializeXml(const QString& fileName)
{
    TemplatexPLDAO dao;
    if(!dao.load(fileName)) {
        qDebug() << dao.getLastError();
        return;
    }
    templates = dao.getSchemas();



}

void MessageCreationDialog::setupUi()
{
    ui->comboMessageType->addItem("cmnd");
    ui->comboMessageType->addItem("stat");
    ui->comboMessageType->addItem("trig");
}



